package com.lanbu.system.service;


import com.lanbu.common.core.domain.AjaxResult;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

public interface IUploadService {
    /**
     * 文件上传前的校验
     * @param fileMd5
     * @param fileExt
     * @return
     */
    String fileRegister(String fileMd5,  String fileExt) throws IOException;

    /**
     * 检查分块
     * @param fileMd5
     * @param chunk
     * @return
     */
    Boolean checkchunk(String fileMd5, Integer chunk);

    /**
     * 分片上传
     * @param file
     * @param fileMd5
     * @param chunk
     * @return
     */
    AjaxResult uploadchunk(MultipartFile file, String fileMd5, Integer chunk);

    /**
     * 组装分片
     * @param fileMd5
     * @param fileExt
     * @return
     */
    String mergechunks(String fileMd5,    String fileExt) throws Exception;

}
